<!DOCTYPE html>
<html class="loading" lang="en" data-textdirection="ltr" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <meta name="author" content="PIXINVENT">
    <title>员工信息查询与变更</title>
    <link rel="stylesheet" type="text/css" th:href="@{/app-assets/css/vendors.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/app-assets/css/vertical-menu.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/app-assets/css/bootstrap-extended.css}">
</head>

    <div class="content-wrapper" >
        <div class="content-header ">
            <div class="content-header-left mb-2">
                <h3 class="content-header-title mb-0">员工信息查询与变更 </h3>
            </div>


        </div>
        <div class="card">
            <div class="card-content">
                <div class="card-body">

                    <div class="searchbox">
                        <form class="form-inline" method="get" th:action="@{/employee_infor/employee_infor}">
                            <div class="form-group">
                                <!--/*@thymesVar id="employee" type="cn.niit.pm.entity.Employee"*/-->
                                <input name="employeeName" type="text" class="form-control" placeholder="请输入员工姓名" th:value="${employee.employeeName}">
                            </div>
                            <div class="form-group">
                                <button type="submit" class="btn btn-primary">查询</button>
                            </div>
                        </form>
                    </div>
                    <div class="funcbtn clearfix">
                        <div class="pull-left">
                            <a class="btn btn-info" th:href="@{/employee_infor/0}">添加员工</a>
                        </div>
                    </div>
                    -
                    <div class="tablebox1">
                        <table class="table">
                            <thead>
                            <tr>
                                <th>员工姓名</th>
                                <th>员工角色</th>
                                <th>所属部门</th>
                                <th>所属岗位</th>
                                <th>性别</th>
                                <th>出生日期</th>
                                <th>邮箱</th>
                                <th>地址</th>
                                <th>手机</th>
                                <th>薪资</th>
                                <th >操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <!--获取列表信息-->
                            <tr th:each="employee,stat : ${employeeList}">
                                <td>
                                    <span th:text="${employee.employeeName}"></span>
                                </td>
                                <td>
                                    <span th:text="(${employee.employeeRole} == 0) ? '总经理' : ((${employee.employeeRole} == 1) ? '部门经理' : '普通员工')"></span>
                                </td>
                                <td>
                                    <span th:text="${employee.departmentName}"></span>
                                </td>
                                <td>
                                    <span th:text="${employee.postName}"></span>
                                </td>
                                <td>
                                    <span th:text="(${employee.gander} == 1) ? '男' : '女'"></span>
                                </td>
                                <td>
                                    <span th:text="${#dates.format(employee.birth, 'yyyy-MM-dd')}"></span>
                                </td>
                                <td>
                                    <span th:text="${employee.email}"></span>
                                </td>
                                <td>
                                    <span th:text="${employee.address}"></span>
                                </td>
                                <td>
                                    <span th:text="${employee.phone}"></span>
                                </td>
                                <td>
                                    <span th:text="${employee.totalSalary}"></span>
                                </td>
                                <td>
                                    <a class="btn btn-primary btn-td" th:href="@{/employee_infor/{id}(id=${employee.employeeId})}">修改</a>
                                    <a class="btn btn-danger btn-td" th:onclick="'del(' + ${employee.employeeId} + ')'" >删除</a>
                                </td>
                            </tr>
                            </tbody>

                        </table>

                        <!--分页组件-->
                        <div th:replace="pager"></div>

                    </div>
                </div>
            </div>
        </div>
    </div>

<script th:src="@{/app-assets/js/vendors.min.js}" type="text/javascript"></script>
<script th:src="@{/app-assets/js/app-menu.js}" type="text/javascript"></script>
<script th:src="@{/app-assets/js/app.js}" type="text/javascript"></script>
<script th:src="@{/app-assets/js/echarts.min.js}" type="text/javascript"></script>
<script th:src="@{/app-assets/js/sweetalert2.js}" type="text/javascript"></script>

<script th:src="@{/app-assets/js/rollpage.js}" type="text/javascript"></script>
<script th:src="@{/app-assets/js/employee.js}" type="text/javascript"></script>
<script>

    document.getElementById("demo2").onclick = function() {
        swal({
                title: "确认要取消吗 ？",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "确认",
                closeOnConfirm: false
            }
        )
    };

</script>
</body>
</html>